<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="keywords" content=""/>
	<title>{$title}</title>
	<link rel="stylesheet" type="text/css" href="css/base.css">
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<script src="js/jquery.min.js"></script>
	<script type="text/javascript" src="http://www.sucaihuo.com/Public/js/other/jquery.js"></script>
	<script type="text/javascript" src="playstyle/Tiger/js/jquery.slotmachine.js"></script>
</head>
 <script type="text/javascript">
$(function() { 
    var machine1 = $("#machine1").slotMachine({  //第一个老虎机设置
        active: 0, //初始化时显示第几张图案
        delay: 500 //延迟
    });

    var machine2 = $("#machine2").slotMachine({
        active: 0,
        delay: 500
    });

    var machine3 = $("#machine3").slotMachine({
        active: 0,
        delay: 500
    });


    $("#slotMachineButton1").click(function() { //开始抽奖
    	 $.ajax({
    	        url: '{$_url}/player/lottery.php',
    	        type: "post",
    	        data:null,
    	        dataType: "json",
    	       // dataType: "text",
    	        timeout: 20000,
    	        cache: false,
    	        beforeSend: function(){// 提交之前
    	        },
    	       error: function(){//出错
    	            alert('积分不足');
    	        },
    	        success: function(res){//成功

    	            machine1.shuffle(3,res.num,1); //调用第一个老虎机

    	            setTimeout(function() { //500秒后调用第二个老虎机
    	                machine2.shuffle(3,res.num,2);
    	            }, 500);
    	            setTimeout(function() { //1000秒后调用第三个老虎机
    	                machine3.shuffle(3,res.num,3);
    	            }, 1000); 
    	            setTimeout(function() { //1000秒后调用第三个老虎机
    	            	if(res == '积分不足'){
        	        		alert(res);
        	            }else{
        	            	if(res.jiangpin){
        	            		alert('恭喜您获得奖品：'+res.jiangpin);
        	            	}else{
        	            		alert('非常遗憾');
        	            	}
        	            } 
    	            }, 2200); 
    	        }
    	    });
    })
});
</script>
        <style type="text/css">
            .slotMachineButton {overflow: hidden; display: inline-block; text-align: center; }
            .slotMachineButton { -moz-box-shadow: inset 0px 1px 0px 0px #fce2c1; -webkit-box-shadow: inset 0px 1px 0px 0px #fce2c1; box-shadow: inset 0px 1px 0px 0px #fce2c1; background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ffc477), color-stop(1, #fb9e25) ); background: -moz-linear-gradient( center top, #ffc477 5%, #fb9e25 100% );  filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc477', endColorstr='#fb9e25');
                                 background-color: #ffc477; border-radius: 75px; border: 6px solid #eeb44f; display: inline-block; color: #ffffff;text-decoration: none; text-align: center; text-shadow: 1px 1px 0px #cc9f52;cursor: pointer; }
            .slotMachineButton:hover { background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #fb9e25), color-stop(1, #ffc477) ); background: -moz-linear-gradient( center top, #fb9e25 5%, #ffc477 100% );  filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fb9e25', endColorstr='#ffc477');
                                       background-color: #fb9e25; }
            .slotMachineButton:active { position: relative; top: 1px; }
            .slotMachine {overflow: hidden; display: inline-block; text-align: center; border: 5px solid #000; background-color: #ffffff; }
            .noBorder { border: none !important; background: transparent !important; font: 14px arial;}
			.slotMachine .slot {width:100px;height:100px;}
			
        </style>
</head>

<body>
	<!--容器-->
	<div class="container">
		<!--内容-->
		<div class="content bc_fcdb43">
			<!--游戏、游戏描述-->
			<div>
				<!--游戏详细-->
				<div class="relative">
					<!--背景图-->
					<div class="f_l relative">
						<img src="/game/playstyle/Tiger/img/machine.png" height="auto" width="100%" alt="">
					</div> 
					<!--背景图结束-->
					<!--游戏开始-->
					 <div class="f_l absolute content">
	                    <div class="tiger_detail_bg">
	                        <div class="tiger_detail_game">
	                            <div id="machine1" class="slotMachine">
	                                <div class="slot slot1"></div>
	                                <div class="slot slot2"></div>
	                                <div class="slot slot3"></div>
	                                <div class="slot slot4"></div>
	                            </div>
	                            <div id="machine2" class="slotMachine">
	                                <div class="slot slot1"></div>
	                                <div class="slot slot2"></div>
	                                <div class="slot slot3"></div>
	                                 <div class="slot slot4"></div>
	                            </div>
	                            <div id="machine3" class="slotMachine">
	                                <div class="slot slot1"></div>
	                                <div class="slot slot2"></div>
	                                <div class="slot slot3"></div>
	                                <div class="slot slot4"></div>
	                            </div>
	                            <div id="slotMachineButton1" class="slotMachineButton">GO</div>
	                            <div class="qfd"></div>
	                        </div>
	                    </div>
	                </div>
					<!-- 游戏结束 -->
					<div class="qfd"></div>
				</div>
				<!--游戏详细结束-->
				<!--游戏描述-->
				<div class="activity_tiger_descBg">
					<div class="activity_tiger_desc">
						<div class="activity_tiger_score">一次游戏消费{$rs['jifen']}个活动积分</div>
						<div class="activity_tiger_btn">立即抽奖</div>
						<div class="activity_tiger_record">
							<a href="/?act=activity&met=activity_record">我的游戏记录</a>
						</div>
					</div>
				</div>
				<!--游戏描述结束-->
			</div>
			<!--游戏、游戏描述结束-->
			<!--游戏奖品-->
			<div class="activity_dicing_rule">
				<!--标题-->
				<div class="activity_tiger_title">
					<div class="activity_tiger_titBg">游戏奖品</div>
				</div>
				<!--标题结束-->
				<!--列表-->
				<div class="activity_tiger_list">
					<ul>
						{$rs['jiangpin']}
					</ul>
				</div>
			</div>
			<!--游戏奖品结束-->
			<!--游戏规则-->
			<div class="activity_dicing_rule">
				<!--标题-->
				<div class="activity_tiger_title">
					<div class="activity_tiger_titBg">游戏规则</div>
				</div>
				<!--标题结束-->
				<!--列表-->
				<div class="activity_tiger_list">
					<ul>
						{$rs['guize']}
					</ul>
				</div>
			</div>
			<!--游戏规则结束-->
			{if(@$winn)}
			<!--中奖名单-->
			<div class="activity_dicing_prize">
				<!--标题-->
				<div class="activity_tiger_title">
					<div class="activity_tiger_titBg">中奖名单</div>
				</div>
				<!--标题结束-->
				<!--列表-->
				<div class="activity_prize_tiger">
					<ul>
						{foreach($winn as $k=>$v1)}
						<li>
							<div class="f_l">恭喜{code(echo substr_replace($v1['phone'],'****',3,4))}</div>
							<div class="f_l">抽中{$v1['jiangpin']}</div>
							<div class="f_l">{if(time() - $v1['time'] < 60)}刚刚
					         {elseif(time() - $v1['time'] < 60*60)}{code(echo floor((time() - $v1['time'])/60))}分钟前
					         {elseif(time() - $v1['time'] < 60*60*12)}{code(echo floor((time() - $v1['time'])/(60*60)))}小时前
					         {else}{code(echo date('m-d H:i',$v1['time']))}{/if}</div>
							<div class="qfd"></div>
						</li>
					    {/foreach}
					</ul>
				</div>
				<!--列表结束-->
			</div>
			<!--中奖名单结束-->
			{/if}
		</div>
		<!--内容结束-->
	</div>
	<!--容器结束-->
</body>
</html>